package com.ff.xyh.consumer.dictionary.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.ff.xyh.common.entity.dictionary.ComplaintType;
import com.ff.xyh.consumer.dictionary.mapper.ComplaintTypeMapper;
import com.ff.xyh.consumer.dictionary.service.ComplaintTypeService;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.springframework.stereotype.Service;

import java.util.List;

/**
 * <p>
 * 投诉类型表 服务实现类
 * </p>
 *
 * @author ff
 * @since 2022-10-26
 */
@Service
public class ComplaintTypeServiceImpl extends ServiceImpl<ComplaintTypeMapper, ComplaintType> implements ComplaintTypeService {

    @Override
    public List<ComplaintType> getAllComplaintType() {
        System.out.println("getAllComplaintType is run");
        return baseMapper.selectList(new QueryWrapper<ComplaintType>().orderByDesc("id"));
    }

    @Override
    public boolean deleteComplaintTypeById(Integer id) {
        return this.removeById(id);
    }

    @Override
    public boolean insertComplaintType(ComplaintType complaintType) {
        return this.save(complaintType);
    }

    @Override
    public boolean updateComplaintType(ComplaintType complaintType) {
        return this.updateById(complaintType);
    }
}
